# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.OSConfig.V1.Model.OSPolicyResourceExecResourceExec do
  @moduledoc """
  A file or script to execute.

  ## Attributes

  *   `args` (*type:* `list(String.t)`, *default:* `nil`) - Optional arguments to pass to the source during execution.
  *   `file` (*type:* `GoogleApi.OSConfig.V1.Model.OSPolicyResourceFile.t`, *default:* `nil`) - A remote or local file.
  *   `interpreter` (*type:* `String.t`, *default:* `nil`) - Required. The script interpreter to use.
  *   `outputFilePath` (*type:* `String.t`, *default:* `nil`) - Only recorded for enforce Exec. Path to an output file (that is created by this Exec) whose content will be recorded in OSPolicyResourceCompliance after a successful run. Absence or failure to read this file will result in this ExecResource being non-compliant. Output file size is limited to 500K bytes.
  *   `script` (*type:* `String.t`, *default:* `nil`) - An inline script. The size of the script is limited to 32KiB.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :args => list(String.t()) | nil,
          :file => GoogleApi.OSConfig.V1.Model.OSPolicyResourceFile.t() | nil,
          :interpreter => String.t() | nil,
          :outputFilePath => String.t() | nil,
          :script => String.t() | nil
        }

  field(:args, type: :list)
  field(:file, as: GoogleApi.OSConfig.V1.Model.OSPolicyResourceFile)
  field(:interpreter)
  field(:outputFilePath)
  field(:script)
end

defimpl Poison.Decoder, for: GoogleApi.OSConfig.V1.Model.OSPolicyResourceExecResourceExec do
  def decode(value, options) do
    GoogleApi.OSConfig.V1.Model.OSPolicyResourceExecResourceExec.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.OSConfig.V1.Model.OSPolicyResourceExecResourceExec do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
